import {
	reqIndexPageData
} from '../../api/index'
Page({
	data: {
		bannerList: [],
		cateList: [],
		activeList: [],
		guessList: [],
		hotList: [],
		loading: true
	},
	onLoad() {
		this.initData()
	},
	// 初始化首页数据
	async initData() {
		const res = await reqIndexPageData()
		console.log(res);
		this.setData({
			bannerList: res[0].data,
			cateList: res[1].data,
			activeList: res[2].data,
			guessList: res[3].data,
			hotList: res[4].data,
			loading: false
		})
	},
	// 转发功能
	onShareAppMessage() {
		return {
			title: '所有的怦然心动，都是你',
			path: '/pages/index/index',
			imageUrl: 'https://gitee.com/flowerTip/person-file/raw/master/love.jpg'
		}
	},
})